package org.demo.szml.eventtype.converter.logging;

import com.alibaba.fastjson.JSON;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @description: 日志详细信息转换类
 * @date: 2025/6/19 23:46
 * @version: 1.0
 */
public class LoggingEventDetailConverter {

    public static String buildLoggingDetail(List<Object> requestArgs,List<Object> responseInfo,String traceId){
        Map<String,String> detailMap = new HashMap<>();
        detailMap.put("timestamp",String.valueOf(System.currentTimeMillis()));
        detailMap.put("requestArg", JSON.toJSONString(requestArgs));
        detailMap.put("responseInfo",JSON.toJSONString(responseInfo));
        detailMap.put("traceId",traceId);
        return JSON.toJSONString(detailMap);
    }
}
